package cn.lxb.emall.user.facade;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RestController;

import cn.lxb.emall.user.api.User;
import cn.lxb.emall.user.api.UserFacade;
import cn.lxb.emall.user.feign.AccountFeignClient;

@RestController
public class UserFacadeImpl implements UserFacade{
	@Value("${server.port}")
	int port;
	@Autowired
	AccountFeignClient accountFeignClient;
	
	@Override
	public String hello(String name) {
		return port+"--hello:"+name;
	}
	
	@Override
	public String getAccount(String name) {
		return accountFeignClient.getAccount(name);
	}
	
	@Override
	public User getUser(User param) {
		param.setId(System.currentTimeMillis());
		return param;
	}

}
